package view;

import java.awt.Dimension;

import javax.swing.BorderFactory;
import javax.swing.JLayeredPane;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

import net.miginfocom.swing.MigLayout;

public class MainPanel extends JPanel {
    private InputPanel inputPanel;
    private JTabbedPane tabbedPane;
    private OutputTable outputTable;
    private JPanel panel;
    private PopulationGraph populationGraph;
    private SampleGraph sampleGraph;
    
    public MainPanel() {
        setLayout(new MigLayout());
        initComponents();
        addComponents();
    }
    
    private void initComponents() {
        inputPanel = new InputPanel();
       // inputPanel.setBorder(BorderFactory.createTitledBorder("Inputs"));
        tabbedPane = new JTabbedPane();
        outputTable = new OutputTable();
       // outputTable.setBorder(BorderFactory.createTitledBorder("Table"));
        panel = new JPanel();
        panel.setLayout(new MigLayout());
        populationGraph = new PopulationGraph();
        sampleGraph = new SampleGraph();
       // outputGraph.setBorder(BorderFactory.createTitledBorder("Graph"));
        tabbedPane.addTab("Population", populationGraph);
        tabbedPane.addTab("Sample", sampleGraph);
        //sampleGraph = new SampleGraph();
    }
    
    private void addComponents() {
        add(inputPanel, "span, wrap");
        add(outputTable);
        add(tabbedPane, "span, split");
        //panel.add(populationGraph, "wrap");
        //panel.add(sampleGraph);
        add(panel);
    }
    
    public InputPanel getInputPanel() {
        return inputPanel;
    }
    
    public OutputTable getOutputTable() {
        return outputTable;
    }
    
    public PopulationGraph getPopulationGraph() {
        return populationGraph;
    }
    
    public SampleGraph getSampleGraph() {
    	return sampleGraph;
    }
}
